package com.example.redis.autoregister.support;

import com.example.redis.autoregister.RedisSerializerFactory;
import com.example.redis.autoregister.RedisSerializerFactoryContext;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;

public class Jackson2JsonRedisSerializerFactory<T> implements RedisSerializerFactory<T> {
    @Override
    public RedisSerializer<T> create(RedisSerializerFactoryContext<T> context) {
        return new Jackson2JsonRedisSerializer<T>(context.getValueType());
    }
}
